postgres/php and windows
am 20.11.2005 23:04:56 von Dave Wayne
This is a multi-part message in MIME format.
------=_NextPart_000_0045_01C5EDDB.634F2880
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Does anyone know if there is a good guide for setting up php to connect =
to postgres under windows? I've set up postgres, however the PConnect =
function fails for some reason.=20
Any help would be appriecated
------=_NextPart_000_0045_01C5EDDB.634F2880
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">
Does anyone know if there is a good =
guide for=20
setting up php to connect to postgres under windows? I've set up =
postgres,=20
however the PConnect function fails for some reason.
Any help would be =
appriecated
------=_NextPart_000_0045_01C5EDDB.634F2880--
Re: postgres/php and windows
am 21.11.2005 00:25:20 von Michael Glaesemann
On Nov 21, 2005, at 7:04 , Dave Wayne wrote:
> Does anyone know if there is a good guide for setting up php to
> connect to postgres under windows? I've set up postgres, however
> the PConnect function fails for some reason.
What's the reason? What error message are you getting? One thing to
check is to make sure PHP was compiled with pgsql support. Provide
more details and hopefully someone will be able to provide better help.
Good luck!
Michael Glaesemann
grzm myrealbox com
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
Unwanted persisting connections
am 21.11.2005 05:06:56 von Gary Hoffman
I've run PHP and PostgreSQL for quite a while and never seen this problem
before. I think it's new, but maybe I never paid attention to it before.
I am frequently running out of connections to the database. Here's a
snippet of my ps -ax
1882 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle =
=20
=20
1883 ?? S 0:00.09 postgres: postgres cgssd_members [local] idle =
=20
=20
1884 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle =
=20
=20
1886 ?? S 0:00.14 postgres: postgres cgssd_members [local] idle =
=20
=20
1887 ?? S 0:00.06 postgres: postgres cgssd_members [local] idle =
=20
=20
500 std- S 0:01.14 /usr/local/bin/postmaster -D
/usr/local/pgsql/data
501 std- S 0:00.02 postgres: stats buffer process =
=20
=20
502 std- S 0:00.21 postgres: stats collector process =
=20
=20
As you can see, there are some idle connections that have come in from PH=
P
on my web pages. I've never seen these before and eventually they build u=
p
and I get an error connecting from the PHP page to the database.
I'm running Apache 1.3.33 on Darwin Kernal 7.9.0 (MacOS X 10.3.9) with PH=
P
4.3.6 and PostgreSQL 7.4.2.
Ideas and suggestions are welcome.
Thanks,
Gary
************************************************************ *************=
*
* Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu =
*
* Graduate School of International Relations and Pacific Studies (IR/PS) =
*
* University of California, San Diego (UCSD) voice: (858) 534-1989 =
*
* 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 =
*
* La Jolla, CA 92093-0519 USA web: http://irps.ucsd.edu/ =
*
************************************************************ *************=
*
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Re: postgres/php and windows
am 21.11.2005 07:36:31 von John DeSoi
On Nov 20, 2005, at 5:04 PM, Dave Wayne wrote:
> Does anyone know if there is a good guide for setting up php to
> connect to postgres under windows? I've set up postgres, however
> the PConnect function fails for some reason.
Did you enable the pgsql dll in the php.ini file? The semicolon needs
to be removed.
;extension=php_pgsql.dll
If that does not solve it, give more specifics about the error.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Re: Unwanted persisting connections
am 21.11.2005 09:58:40 von Andrew McMillan
--=-ZQdnxV9V3hwTkcnI7/T6
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
On Sun, 2005-11-20 at 20:06 -0800, Gary Hoffman wrote:
> I've run PHP and PostgreSQL for quite a while and never seen this problem
> before. I think it's new, but maybe I never paid attention to it before.
>=20
> I am frequently running out of connections to the database. Here's a
> snippet of my ps -ax
>=20
> 1882 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle =
=20
> =20
> 1883 ?? S 0:00.09 postgres: postgres cgssd_members [local] idle =
=20
> =20
> 1884 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle =
=20
> =20
> 1886 ?? S 0:00.14 postgres: postgres cgssd_members [local] idle =
=20
> =20
> 1887 ?? S 0:00.06 postgres: postgres cgssd_members [local] idle =
=20
> =20
> 500 std- S 0:01.14 /usr/local/bin/postmaster -D
> /usr/local/pgsql/data
> 501 std- S 0:00.02 postgres: stats buffer process =
=20
> =20
> 502 std- S 0:00.21 postgres: stats collector process =
=20
> =20
>=20
> As you can see, there are some idle connections that have come in from PH=
P
> on my web pages. I've never seen these before and eventually they build u=
p
> and I get an error connecting from the PHP page to the database.
>=20
> I'm running Apache 1.3.33 on Darwin Kernal 7.9.0 (MacOS X 10.3.9) with PH=
P
> 4.3.6 and PostgreSQL 7.4.2.
You will have as many of these as you have apache processes. That's
what persistent connections means!
If you have MaxClients set to (e.g.) 150 in your Apache configuration,
and you actually get to something like that, then the default PostgreSQL
configuration of 100 clients simply won't be enough. You should
increase it to at leas 20-50 more than the MaxClients setting that
Apache has.
You'll be pleased to know that each extra PostgreSQL connection
typically uses less than each additional Apache connection (especially
when you're running PHP et al.) so if you find yourself running out of
RAM you will need to lower the MaxClients setting first.
Regards,
Andrew McMillan.
------------------------------------------------------------ -------------
Andrew @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)803-2201 MOB: +64(272)DEBIAN OFFICE: +64(4)499-2267
You will be a winner today. Pick a fight with a four-year-old.
------------------------------------------------------------ -------------
--=-ZQdnxV9V3hwTkcnI7/T6
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBDgYxAjJA0f48GgBIRAu4QAJwNBZ00eD6DAw8eSUtih6YAhkTAwgCg uwRh
ZpGziUuFV+gGpGEVsQz/6dE=
=6PR6
-----END PGP SIGNATURE-----
--=-ZQdnxV9V3hwTkcnI7/T6--
Re: postgres/php and windows
am 21.11.2005 14:58:20 von CGMoller
In addition to error messages, what is your setup? What versions of PHP,
Postgres and Web (Apache?) are you using? The configurations are different
depending upon what you have installed.
Also you should check the PHP manual:
http://us3.php.net/manual/en/function.pg-connect.php.
Cameron G. Moller
Michael
Glaesemann
om> Dave Wayne
Sent by: cc
pgsql-php-owner@p pgsql-php@postgresql.org
ostgresql.org Subject
Re: [PHP] postgres/php and windows
11/20/2005 06:25
PM
On Nov 21, 2005, at 7:04 , Dave Wayne wrote:
> Does anyone know if there is a good guide for setting up php to
> connect to postgres under windows? I've set up postgres, however
> the PConnect function fails for some reason.
What's the reason? What error message are you getting? One thing to
check is to make sure PHP was compiled with pgsql support. Provide
more details and hopefully someone will be able to provide better help.
Good luck!
Michael Glaesemann
grzm myrealbox com
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Re: postgres/php and windows
am 21.11.2005 19:39:41 von manjusri schuit
------=_Part_29060_19692797.1132598381776
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello
First you will need to know wheter php is been setup corectly.
Paste this
phpinfo()
?>
into a textfile or you're favorite editor and save it as phpinfo.php or so
in you're webroot (mydrive\Apache Group\ApacheX\htdocs)
then goto http://localhost/phpinfo.php
1) Configurationfile (php.ini) Path must piont to the place wher you stored
you're php ini.
2) if you scroll down a bit you will find a block with "pgpsql" witchs mean=
s
that you have postgres support enabled in php.
If not found that means you're php ini is not setup correctly
check www.php.net for more info on how to setup php.in=
i
..
--
Met vriendelijke groet
Manjusri Schuit
On 11/20/05, Dave Wayne wrote:
>
> Does anyone know if there is a good guide for setting up php to connect t=
o
> postgres under windows? I've set up postgres, however the PConnect functi=
on
> fails for some reason.
> Any help would be appriecated
>
------=_Part_29060_19692797.1132598381776
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello
First you will need to know wheter php is been setup corectly.
Paste this
<?php
phpinfo()
?>
into a textfile or you're favorite editor and save it as phpinfo.php or
so in you're webroot (mydrive\Apache Group\ApacheX\htdocs)
then goto http://localhost/phpinfo=
..php
1) Configurationfile (php.ini) Path must piont to the place wher you stored=
you're php ini.
2) if you scroll down a bit you will find a block with "pgpsql"&n=
bsp;
witchs means that you have postgres support enabled in php.
If not found that means you're php ini is not setup correctly
check for more info on how t=
o setup php.ini.
--
Met vriendelijke groet
Manjusri Schuit
On 11/20/05,
ss=3D"gmail_sendername">Dave Wayne <
..ca">davewayne@shaw.ca> wrote:
e" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt =
0.8ex; padding-left: 1ex;">
Does anyone know if there is a good gu=
ide for=20
setting up php to connect to postgres under windows? I've set up postgres,=
=20
however the PConnect function fails for some reason.
Any help would be appriecated=
div>
------=_Part_29060_19692797.1132598381776--
Re: postgres/php and windows
am 21.11.2005 20:26:20 von operationsengineer1
--- Dave Wayne wrote:
> Does anyone know if there is a good guide for
> setting up php to connect to postgres under windows?
> I've set up postgres, however the PConnect function
> fails for some reason.=20
>=20
> Any help would be appriecated
Dave, I have developed detailed instructions to
install Apache, with PHP CGI support, and Postgresql
8.0.
I will put them online and post a link later today.
OE1
=09
__________________________________=20
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Re: Unwanted persisting connections
am 21.11.2005 22:13:15 von Philip Hallstrom
On Mon, 21 Nov 2005, Andrew McMillan wrote:
> On Sun, 2005-11-20 at 20:06 -0800, Gary Hoffman wrote:
>> I've run PHP and PostgreSQL for quite a while and never seen this problem
>> before. I think it's new, but maybe I never paid attention to it before.
>>
>> I am frequently running out of connections to the database. Here's a
>> snippet of my ps -ax
>>
>> 1882 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle
>>
>> 1883 ?? S 0:00.09 postgres: postgres cgssd_members [local] idle
>>
>> 1884 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle
>>
>> 1886 ?? S 0:00.14 postgres: postgres cgssd_members [local] idle
>>
>> 1887 ?? S 0:00.06 postgres: postgres cgssd_members [local] idle
>>
>> 500 std- S 0:01.14 /usr/local/bin/postmaster -D
>> /usr/local/pgsql/data
>> 501 std- S 0:00.02 postgres: stats buffer process
>>
>> 502 std- S 0:00.21 postgres: stats collector process
>>
>>
>> As you can see, there are some idle connections that have come in from PHP
>> on my web pages. I've never seen these before and eventually they build up
>> and I get an error connecting from the PHP page to the database.
>>
>> I'm running Apache 1.3.33 on Darwin Kernal 7.9.0 (MacOS X 10.3.9) with PHP
>> 4.3.6 and PostgreSQL 7.4.2.
>
> You will have as many of these as you have apache processes. That's
> what persistent connections means!
You can end up with a *lot* more than apache's MaxClients if you open
persistent connections with different connection paramaters... so keep
that in mind if you're connecting to more than one database.
You might look at pgpool. Never used it, but it comes up frequently as a
solution to this...
>
> If you have MaxClients set to (e.g.) 150 in your Apache configuration,
> and you actually get to something like that, then the default PostgreSQL
> configuration of 100 clients simply won't be enough. You should
> increase it to at leas 20-50 more than the MaxClients setting that
> Apache has.
>
> You'll be pleased to know that each extra PostgreSQL connection
> typically uses less than each additional Apache connection (especially
> when you're running PHP et al.) so if you find yourself running out of
> RAM you will need to lower the MaxClients setting first.
>
> Regards,
> Andrew McMillan.
>
> ------------------------------------------------------------ -------------
> Andrew @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
> WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
> DDI: +64(4)803-2201 MOB: +64(272)DEBIAN OFFICE: +64(4)499-2267
> You will be a winner today. Pick a fight with a four-year-old.
> ------------------------------------------------------------ -------------
>
>
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Re: postgres/php and windows
am 22.11.2005 08:36:07 von operationsengineer1
--- Dave Wayne wrote:
> Does anyone know if there is a good guide for
> setting up php to connect to postgres under windows?
> I've set up postgres, however the PConnect function
> fails for some reason.=20
>=20
> Any help would be appriecated
Dave,
Check out this link...
http://www.geocities.com/operationsengineer1/
for my attempt to create a tutorial to isntall
Apache2, PHP5 and PGSQL8 on WinXP.
the links are for pdf files and they are about a meg
each. the webhost only allows a limited amount of
transfer bandwidth, so be sure to return if the limit
is exceeded.
I would also suggest that others not check the links
unless they are actively trying this install - at
least until Dave is able to download the files.
I will get the instructions up via a web page, but it
proved to be difficult using geocities.
Do fweel free to offer suggestions and point out
errors of any kind.
Good luck,
OE1
=09
__________________________________=20
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq